package cz.muni.fi.pa165.sme.dao.api;

import java.util.List;

import cz.muni.fi.pa165.sme.dao.entity.BurnedCalories;
import cz.muni.fi.pa165.sme.dao.entity.SportActivity;
import cz.muni.fi.pa165.sme.dao.exception.ReferenceIntegrityException;

/**
 *
 * An interface for management of {@link BurnedCalories} entities in a storage.
 * 
 * @author Amruz
 */
public interface BurnedCaloriesDao {

	/**
	 * Adds a new {@link BurnedCalories} to a storage, creates its ID. Object's ID must be null.
	 *
	 * @param burnedCalories {@link BurnedCalories} to be created.
	 */
	void createBurnedCalories(final BurnedCalories burnedCalories);

	/**
	 * Removes a {@link BurnedCalories} object from a storage. Object's ID must not be null.
	 *
	 * @param burnedCalories {@link BurnedCalories} to be removed.
	 * @throws ReferenceIntegrityException if the requested object is referenced in the storage.
	 */
	void deleteBurnedCalories(final BurnedCalories burnedCalories);

	/**
	 * Updates a {@link BurnedCalories} object as requested. Object's ID must not be null; parameters can be
	 * changed to null where applicable.
	 *
	 * @param burnedCalories {@link BurnedCalories} to be updated
	 */
	void updateBurnedCalories(final BurnedCalories burnedCalories);

	/**
	 * Finds a {@link BurnedCalories} object by its ID.
	 *
	 * @param id ID to be looked up in the storage
	 * @return {@link BurnedCalories} with the provided ID, or null if none found
	 */
	BurnedCalories findBurnedCalories(final Long id);

	/**
	 * Finds all {@link BurnedCalories}s which are higher than calories.
	 *
	 * @param calories CALORIES to get the data for; must not be null
	 * @return list of all related {@link BurnedCalories}s; never null.
	 */
	List<BurnedCalories> findBurnedCaloriesHigherThenCalories(final Long calories);

	/**
	 * Finds all {@link BurnedCalories}s related to the provided {@link SportActivity}.
	 *
	 * @param sportActivity {@link SportActivity} object to get the data for; must not be null
	 * @return list of all related {@link BurnedCalories}s; never null
	 */
	List<BurnedCalories> findAllBurnedCaloriesBySportActivity(final SportActivity sportActivity);

	/**
	 * Returns all {@link BurnedCalories}s from the storage.
	 *
	 * @return list of all {@link BurnedCalories}s; never null.
	 */
	List<BurnedCalories> findAllBurnedCalories();
}
